#pragma once

#ifndef _HeightMap_h_
#define _HeightMap_h_

#include <d3d9.h>

namespace MyGame {

class HeightMap {
public:
    HeightMap(UINT width, UINT length);
    virtual ~HeightMap(void);
    int GetLength();
    FLOAT** GetMap();
    FLOAT GetMaxElevation();
    int GetWidth();
    static void Blend(HeightMap* h1, HeightMap* h2, FLOAT amount);
    HeightMap* Clone();
    static HeightMap* Crop(HeightMap* heightMap, int w1, int l1, int w2, int l2);
    static void Normalize(HeightMap* heightMap);
    static void Normalize(HeightMap* heightMap, FLOAT scale);
private:
    UINT length;
    UINT width;
    FLOAT **map;
};

}

#endif
